﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebApiExample.Adapters.Interfaces;
using WebApiExample.Data;
using WebApiExample.Model;

namespace WebApiExample.Adapters.Data
{
    public class PetDataAdapter : IPetAdapter
    {
        public Pet GetPet(int id)
        {
            Pet pet = new Pet();
            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                pet = db.Pets.Where(i => i.PetId == id).FirstOrDefault();
            }
            return pet;
        }
    }
}